package com.baomidou.springwind.pojo;


import com.baomidou.springwind.entity.NetworkDelivery;
import com.baomidou.springwind.utils.CityUtil;

/**
 * 位置距离对象
 *
 * @Author demo
 * @Date 2017-8-6
 */
public class SiteDistance {

    public final NetworkDelivery site1;
    public final NetworkDelivery site2;
    public final Double disance;

    public SiteDistance(NetworkDelivery site1, NetworkDelivery site2) {
        this.site1 = site1;
        this.site2 = site2;
        disance = CityUtil.getDistance(site1.getCoordinateX().doubleValue(), site1.getCoordinateY().doubleValue(),
                site2.getCoordinateX().doubleValue(), site2.getCoordinateY().doubleValue());
    }

    @Override
    public String toString() {
        return "SiteDistance{" +
                "site1=" + site1 +
                ", site2=" + site2 +
                ", disance=" + disance +
                '}';
    }
}
